package net.sf.log4jdbc;

public final class InitDataHelper {
    private static String[] inpkgs;
    private static String[] expkgs;

    public static boolean isIncludePackage(String classname) {
        int tmp = 0;
        if (inpkgs == null || inpkgs.length == 0)
            return false;
        for (int j = 0; j < inpkgs.length; j++) {
            if (inpkgs[j] != null && !("").equals(inpkgs[j]) && classname.startsWith(inpkgs[j])) {
                tmp++;
                break;
            }
        }
        return tmp > 0;
    }

    public static boolean isExcludePackage(String classname) {
        int tmp = 0;
        if (expkgs == null || expkgs.length == 0)
            return false;
        for (int j = 0; j < expkgs.length; j++) {
            if (expkgs[j] != null && !("").equals(expkgs[j]) && classname.startsWith(expkgs[j])) {
                tmp++;
                break;
            }
        }
        return tmp > 0;
    }

    public static void main(String[] args) {
        String string = "com.aaa.ida40.common.ResponsibilityFilter";
        String[] a = { "com.aaa.baf", "com.aaa.ida40" };
        String[] b = { "com.aaa.bdf.rbpm", "com.aaa.ida40.common", "com.aaa.common.filter" };
        InitDataHelper.expkgs = b;
        InitDataHelper.inpkgs = a;
        System.out.println(InitDataHelper.isIncludePackage(string));
    }
}
